<template>
    <el-dialog v-model="visible" title="膨胀运动设置" width="30%" draggable>
        <div>
            <el-row>
                <label for="selrotategraphbtnID" style="padding-right:10px;position: relative; left:10px">膨胀对象</label>
                <el-button id="selrotategraphbtnID" type="primary" @click="onSelRotateGraphs">
                    图中选择
                </el-button>
            </el-row>
            <el-row>
                <label for="speedInputID" style="padding-right:10px;position: relative; left:10px">膨胀速度(百分比/每秒)</label>
                <el-input v-model="speed" autofocus size="mini"  id="speedInputID"></el-input>
            </el-row>
            <el-row>
                <label for="MaxScaleInputID" style="padding-right:10px;position: relative; left:10px">最大比例(百分比)</label>
                <el-input v-model="maxScale" autofocus size="mini"  id="MaxScaleInputID"></el-input>
            </el-row>

            <el-row>
                <label for="MinScaleInputID" style="padding-right:10px;position: relative; left:10px">最小比例(百分比)</label>
                <el-input v-model="minScale" autofocus size="mini"  id="MinScaleInputID"></el-input>
            </el-row>
            
        </div>
        <template #footer>
            <span class="dialog-footer">
                <el-button @click="visible = false">Cancel</el-button>
                <el-button type="primary" @click="onConfirm">
                    Confirm
                </el-button>
            </span>
        </template>
    </el-dialog>
</template>
        
<script  setup>
import { ref, onMounted } from 'vue'
import {LGXEnums}  from '../../script/canvas/common/sysenum'
const visible = ref(false)
const speed = ref(20)
const destList = ref([]);
const maxScale = ref(200);
const minScale = ref(10)

onMounted(() => {
    // window.mainctl.appendSelGraphListner(this);
})

var notifySelGraph = function (mousePoint,list) {
    console.log("rotate act2PickGraphs --------------");
    window.mainctl.removeSelGraphListner(window.InflateAnimateDlg.value);
    visible.value = true;
    destList.value = list;
}

const onConfirm = () => {
    console.log("rotate animate  confirm --------------");
    visible.value = false;
    let inflateSpeed = speed.value/100;
    let max = maxScale.value/100;
    let min = minScale.value/100;
    let animateInfo = { obj: destList.value, speed:inflateSpeed , max,min};
    window.mainctl.m_pAnimateINTF.setAnimate("inflate", animateInfo);
}

const onSelRotateGraphs = () => {
    visible.value = false;
    window.mainctl.setMapWorkMode(LGXEnums.LGXWorkMode.ModifyMode);
    window.mainctl.appendSelGraphListner(window.InflateAnimateDlg.value);
}

defineExpose({
    visible,
    onMounted,
    notifySelGraph
});

</script>
        